package com.wlc.controller;

import com.alibaba.nacos.api.annotation.NacosProperties;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import com.wlc.config.PlatformContextHolder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 王立朝
 * @date 2024/6/22
 * @description:
 */
@RestController
@RefreshScope
public class IndexController {
	/**
	 * 读取 username 配置信息
	 */
	@Value("${msg}")
	private String msg;
	@Value(value = "${myusername}")
	private String namestr;

	@GetMapping("/test")
	public String getName() {
		System.out.println("name = " + namestr);
		return msg+ "   " + namestr;
	}
}
